<template>
    <div style="width: 200px">
        <el-tree
                :props="props"
                :load="loadNode"
                lazy
                @node-click="nodeClick"
                :show-checkbox="showCheckbox">
        </el-tree>
    </div>
</template>

<script>

    export default {
        name: "user-dept-position",
        props:{
            showCheckboxModel:{
                type: Boolean
            }
        },
        data() {
            return {
                showCheckbox:this.showCheckboxModel,
                props: {
                    label: 'name',
                    children: 'zones',
                    isLeaf: 'leaf'
                },
            };
        },
        methods: {
            nodeClick(data, n, x){
                this.$emit("node-click", data)
            },
            loadNode(node, resolve) {
              this.$emit("loadNode",node, resolve)

            }
        }
    };
</script>

<style scoped>

</style>
